{% extends 'TopxiaWebBundle:CourseManage/Dashboard:layout.html.twig' %}
{% do load_script('course-manage/dashboard/lesson-detail.js') %}
{% set submenu = 'lesson_learn_dashboard' %}
{% block dashboard %}

<div class="table-responsive">
  <table class="table table-bordered" id="learning-data-table" style="word-break:break-all;text-align:center;">
    <tr class="active">
      <td width="35%">{{'课时名'|trans}}</td>

      <td>{{'课时平均学习时长(分)'|trans}}
        <span data-toggle="popover" class="glyphicon glyphicon-question-sign color-gray text-sm average-learn-lesson-popover"></span>
        <div class="popover-content hidden">
          <div class="popover-item">
            <div class="content">{{ '课时学习时长：停留在该课时页面的时间，课时平均学习时长：每个学员的课时学习时长的平均数'|trans }}</div>
            </div>
          </div>
        </div>
      </td>

      <td>{{'音视频时长(分)'|trans}}
        <span data-toggle="popover" class="glyphicon glyphicon-question-sign color-gray text-sm video-popover"></span>
        <div class="popover-content hidden">
          <div class="popover-item">
            <div class="content">{{'音视频的实际时长，仅支持云视频'|trans }}</div>
            </div>
          </div>
        </div>
      </td>

      <td>{{'音视频平均观看时长(分)'|trans}}
        <span data-toggle="popover" class="glyphicon glyphicon-question-sign color-gray text-sm average-video-popover"></span>
        <div class="popover-content hidden">
          <div class="popover-item">
            <div class="content">{{'每个学员的实际观看时长的平均数'|trans }}</div>
            </div>
          </div>
        </div>
      </td>

      <td>{{'测试平均得分'|trans}}
        <span data-toggle="popover" class="glyphicon glyphicon-question-sign color-gray text-sm average-score-popover"></span>
        <div class="popover-content hidden">
          <div class="popover-item">
            <div class="content">{{'每个学员测试得分的平均数'|trans }}</div>
            </div>
          </div>
        </div>
      </td>

      <td></td>
   {# <td>直播同时在线人数峰值</td> #}
    </tr>
    {% if lessons %}
      {% for lesson in lessons %}
        <tr>
          <td>
            {{lesson.title}}{% if lesson.type == "text" %}{{'（图文）'|trans}}{% elseif lesson.type == 'video' %}{{'（视频）'|trans}}{% elseif lesson.type == 'audio' %}{{'（音频）'|trans}}{% elseif lesson.type == 'testpaper' %}{{'（试卷）'|trans}}{% elseif lesson.type == 'ppt' %}（ppt）{% endif %}
          </td>
          <td>{{(lesson.learnTime/60)|round(0, 'floor')}}</td>
          <td>{% if lesson.type =='audio' or lesson.type =='video' %}{{lesson.length}}{% else %}----{% endif %}</td>
          <td>{% if lesson.mediaSource != 'self' and lesson.type == 'video' %}{{'无'|trans}}{% elseif lesson.type =='audio' or lesson.type =='video'%}{{(lesson.watchTime/60)|round(0, 'floor')}}{% else %}----{% endif %}</td>
          <td>{% if lesson.type =='testpaper' %}{{lesson.score}}{% else %}----{% endif %}</td>
          <td>
          <a data-toggle="modal" data-target="#modal" data-url="{{path('course_lesson_detail_data',{courseId:lesson.courseId,lessonId:lesson.id})}}" href="javascript:">学员学习详情</a>
          </td>
        </tr>
      {% endfor %}
    {% endif %}
  </table>
  <p class="text-success">{{'注：网络视频的观看时长无法获取'|trans}}</p>
</div>

{% endblock %}